import Vue from 'vue';
import Router from 'vue-router';
import Columns from 'components/main/columns/Columns';
import Create from 'components/main/columns/Create';
import Bundle from 'components/main/columns/Bundle';
import ColumnsManage from 'components/main/columns/ColumnsManage';
import CreateInfo from 'components/main/columns/CreateInfo';
import CreatePrice from 'components/main/columns/CreatePrice';

import Expert from 'components/main/expert/Expert';

import ContentList from 'components/main/columns/ContentList';
import Publish from 'components/main/columns/Publish';
import Journal from 'components/main/columns/Journal';

import Video from 'components/main/columns/publish/Video';
import Audio from 'components/main/columns/publish/Audio';
import Article from 'components/main/columns/publish/Article';

Vue.use(Router);

export default new Router({
  routes: [{
    path: '/',
    redirect: '/columns'
  }, {
    path: '/columns', // 专栏管理
    name: 'Columns',
    component: Columns,
    redirect: '/columns/create',
    children: [{
      path: 'create', // 创建专栏
      name: 'create',
      component: Create,
      redirect: '/columns/create/type',
      children: [{
        path: 'type',
        name: 'type',
        component: ColumnsManage
      }, {
        path: 'info/:id',
        name: 'info',
        component: CreateInfo
      }, {
        path: 'price/:id',
        component: CreatePrice
      }]
    }, {
      path: 'bundles/:id', // 课程包
      redirect: 'bundles/:id/list',
      children: [{
        path: 'list'
      }, {
        path: 'edit'
      }, {
        path: 'create'
      }, {
        path: 'classes/:cid',
        children: [{
          path: 'edit'
        }]
      }]
    }, {
      path: 'journal/:id/:issue', // 期刊
      component: Journal,
      redirect: 'journal/:id/:issue/list',
      children: [{
        path: 'list',
        name: 'List',
        component: ContentList
      }, {
        path: 'edit'
      }, {
        path: 'create_issue'
      }, {
        path: 'publish',
        name: 'Publish',
        component: Publish,
        redirect: 'publish/video',
        children: [{
          path: 'video',
          name: 'video',
          component: Video
        }, {
          path: 'audio',
          name: 'audio',
          component: Audio
        }, {
          path: 'article',
          name: 'article',
          component: Article
        }]
      }]
    }]
  }, {
    path: '/expert', // 电台设置
    name: 'Expert',
    component: Expert
  }]
});
